// 盛最多水的容器
class Solution5 {
    public int maxArea(int[] height) {
        int left = 0, right = height.length - 1, v = 0;
        while (left < right) {
            int res = Math.min(height[left], height[right]) * (right - left);
            v = Math.max(v, res);
            if (height[left] < height[right]) {
                left++;
            } else {
                right--;
            }
        }
        return v;
    }
}